var app = getApp();

Page({
    data: {
        none: [ {
            img: "/hyb_jianzhi/images/none_03.png",
            con: "暂无管理员"
        } ],
        adminList:[]
    },
    onLoad: function(t) {
        var self = this;
        self.getAdminList()
    },
    getAdminList:function(){
        var self = this;
         app.util.request({
            url: "entry/wxapp/ShopUserlist",
            data:{
               u_id: self.data.f_uid,
               openid: wx.getStorageSync("openid")
            },
            success: function(t) {
                 self.setData({
                    adminList:t.data.data
                });
            }
        }) 
    },
    delAdmin:function(e){
        var self = this;
        
         app.util.request({
            url: "entry/wxapp/ShopUserdel",
            data:{
               u_id: e.currentTarget.dataset.f_id,
               openid: wx.getStorageSync("openid")
            },
            success: function(t) {
                 wx.showToast({
                  title: "删除成功!"
                 });
                 self.getAdminList();
            }
        }) 
    },
    addAdmin: function(a) {
         wx.navigateTo({
            url: "/hyb_jianzhi/addadmin/addadmin"
        });
    },
    onShow: function() {
        this.getAdminList()
    },
    onShareAppMessage: function() {}
});